package com.mmr.dxp.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;


/**
 * 推送失败需要重新推送的数据
 * @table DATA_TOBE_PUSHED
 * @author chenyl
 */

@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DataTobePushed implements Serializable {

    private static final long serialVersionUID = -1598602737141196732L;
    @Id
    private Integer id;
    /**
     * 执行类名称
     */
    private String className;
    /**
     * 执行方法名称
     */
    private String methodName;
    /**
     * 请求头参数
     */
    private String reqHeaders;
    /**
     * 请求体参数
     */
    private String reqBody;
    /**
     * 最后更新时间
     */
    private Date updateTime;

    public DataTobePushed(String className, String methodName, String reqHeaders, String reqBody) {
        this.className = className;
        this.methodName = methodName;
        this.reqHeaders = reqHeaders;
        this.reqBody = reqBody;
        this.updateTime = new Date();
    }

    public DataTobePushed(String className, String methodName, String reqBody) {
        this.className = className;
        this.methodName = methodName;
        this.reqBody = reqBody;
        this.updateTime = new Date();
    }
}